package com.yanqu.road.entity.activity.tonbingchannel.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 阵营数据
 */
@FieldTypeAnnotation(desc = "t_c_tonbing_camp_match_data")
public class ChannelTonBingCampMatchData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "阵营ID", update = true)
    private int campId;

    @FieldTypeAnnotation(desc = "城池采集收益（玩家ID，城池ID，数量）")
    private Map<Long, Map<Integer, Long>> collectionMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "指挥官数据")
    private ChannelTonBingCommanderData commanderData;

    private int matchId;


    // ==================================================

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getCampId() {
        return campId;
    }

    public void setCampId(int campId) {
        if (this.campId != campId) {
            this.campId = campId;
            setOp(DataStatus.Update);
        }
    }

    public Map<Long, Map<Integer, Long>> getCollectionMap() {
        return collectionMap;
    }

    public void setCollectionMap(ConcurrentHashMap<Long, ConcurrentHashMap<Integer, Long>> collectionMap) {
        if (null == collectionMap) {
            return;
        }
        this.collectionMap = new ConcurrentHashMap<>(collectionMap);
        setOp(DataStatus.Update);
    }

    public ChannelTonBingCommanderData getCommanderData() {
        return commanderData;
    }

    public void setCommanderData(ChannelTonBingCommanderData commanderData) {
        if (commanderData == null) {
            return;
        }
        this.commanderData = commanderData;
        setOp(DataStatus.Update);
    }

    public int getMatchId() {
        return matchId;
    }

    public void setMatchId(int matchId) {
        this.matchId = matchId;
    }
}
